package com.zb.vo;

import com.zb.annotation.NumberLengthPattern;
import com.zb.annotation.NumberPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/9/8 0008
 **/
@Data
@ApiModel("组件对象")
public class CodePrintTemplateComponentChildVo {
    @ApiModelProperty(value = "组件ID，新增不必传，修改必传")
    private Long id;

    @NotBlank(message = "组件属性不能为空")
    @Length(max = 20, message = "组件属性限制 20 个字符以内")
    @ApiModelProperty(value = "组件属性", required = true)
    private String name;

    @NotNull(message = "组件类型不能为空")
    @NumberPattern(regexp = "^(1|2|3)$", message = "组件类型类型参数不合法", required = true)
    @ApiModelProperty(value = "组件类型：1-编码组件，2-图片组件，3-文本组件", required = true, example = "1")
    private Integer type;

    @NotNull(message = "宽度不能为空")
    @NumberLengthPattern(max = 10, message = "宽度总长度限制 10 个字符以内")
    @NumberPattern(regexp = "^[1-9]\\d{0,2}|([1-9]\\d{0,2})(\\.[0-9]*)|0\\.([0-9]*)$", message = "宽度只允许输入 >0，且长度为 <= 3 位的正整数")
    @ApiModelProperty(value = "宽度", required = true, example = "50")
    private Float width;

    @NotNull(message = "高度不能为空")
    @NumberLengthPattern(max = 10, message = "高度总长度限制 10 个字符以内")
    @NumberPattern(regexp = "^[1-9]\\d{0,2}|([1-9]\\d{0,2})(\\.[0-9]*)|0\\.([0-9]*)$", message = "高度只允许输入 >0，且长度为 <= 3 位的正整数")
    @ApiModelProperty(value = "高度", required = true, example = "50")
    private Float height;

    @NotNull(message = "锁定比例不能为空")
    @ApiModelProperty(value = "是否锁定比例：false-不锁定，true-锁定", required = true, example = "false")
    private Boolean lockScale;

    @NotNull(message = "锁定比例大小不能为空")
    @NumberLengthPattern(max = 10, message = "锁定比例大小总长度限制 10 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "锁定比例大小只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "锁定比例大小", required = true, example = "0")
    private Float scaleSize;

    @NotNull(message = "坐标X不能为空")
    @NumberLengthPattern(max = 20, message = "坐标X总长度限制 20 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "坐标X只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "坐标X", required = true, example = "0")
    private Float coordinateX;

    @NotNull(message = "坐标Y不能为空")
    @NumberLengthPattern(max = 20, message = "坐标Y总长度限制 20 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "坐标Y只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "坐标Y", required = true, example = "0")
    private Float coordinateY;

    @NotNull(message = "旋转角度不能为空")
    @NumberLengthPattern(max = 20, message = "旋转角度总长度限制 20 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "旋转角度只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "旋转角度", required = true, example = "0")
    private Float rotateAngle;

    @NotNull(message = "编码类型不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "编码类型参数不合法")
    @ApiModelProperty(value = "编码类型: 1-二维码，2-一维码", required = true, example = "1")
    private Integer codeType;

    @Length(max = 300, message = "图片路径总长度限制 300 个字符以内")
    @ApiModelProperty(value = "图片路径")
    private String image;

    @NotNull(message = "文本字体不能为空")
    @NumberPattern(regexp = "^(1|2|3|4|5|6|7)$", message = "文本字体参数不合法")
    @ApiModelProperty(value = "文本字体：1-微软雅黑，2-黑体，3-宋体，4-楷体，5-隶书，6-幼圆，7-仿宋", required = true, example = "1")
    private Integer textFont;

    @NotNull(message = "文本字号不能为空")
    @NumberLengthPattern(max = 10, message = "文本字号长度限制 10 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "文本字号只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "文本字号", required = true, example = "0")
    private Float textWordSize;

    @NotNull(message = "文本行高不能为空")
    @NumberLengthPattern(max = 10, message = "文本行高长度限制 10 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "文本行高只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "文本行高")
    private Float textRowHeight;

    @NotNull(message = "首行缩进不能为空")
    @NumberLengthPattern(max = 10, message = "首行缩进长度限制 10 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "首行缩进只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "首行缩进")
    private Float textIndent;

    @NotNull(message = "文本间距不能为空")
    @NumberLengthPattern(max = 10, message = "文本间距长度限制 10 个字符以内")
    @NumberPattern(regexp = "^(0?|[1-9]\\d{0,3})|([1-9]\\d{0,3})(\\.[0-9]*)|0\\.([0-9]*)$", message = "文本间距只允许输入 >=0，且正整数长度 <=4 位的数值")
    @ApiModelProperty(value = "文本间距")
    private Float textSpacing;

    @NotNull(message = "文本对齐方式不能为空")
    @NumberPattern(regexp = "^(1|2|3|)$", message = "文本对齐方式参数不合法")
    @ApiModelProperty(value = "文本对齐方式：1-右对齐，2-居中对齐，3-左对齐", required = true, example = "1")
    private Integer textAlign;

    @NotNull(message = "文本加粗项不能为空")
    @ApiModelProperty(value = "是否文本加粗：false-不加粗，true-加粗", required = true, example = "false")
    private Boolean textBold;

    @NotNull(message = "文本倾斜项不能为空")
    @ApiModelProperty(value = "是否文本倾斜：false-不倾斜，true-倾斜", required = true, example = "false")
    private Boolean textIncline;

    @NotNull(message = "文本下划线项不能为空")
    @ApiModelProperty(value = "是否要文本下划线：false-不加下划线，true-加下划线", required = true, example = "false")
    private Boolean textUnderline;

    @Length(max = 10, message = "文本颜色限制 10 个字符以内")
    @ApiModelProperty(value = "文本颜色")
    private String textColor;

    @ApiModelProperty(value = "数据类型对象")
    private List<CodePrintTemplateComponentDataTypeVo> dataTypeVos;

    @ApiModelProperty(value = "删除的数据类型对象ID集合")
    private List<Long> delDataTypeIds;
}
